<?php
class FooterWidget  extends CWidget{
    
	//输出字符串
	private $out = '';
    
    private $controller= '';
    
    private $action= '';

	public function init(){
        $this->controller = Yii::app()->controller->id;  
        $this->action = Yii::app()->controller->action->id; 
	}

	public function run(){
        $this->generateFooter();
		echo $this->out;
	}
    
    public function generateFooter(){
        $baseScript = Yii::app()->request->baseUrl;
        $titleString = CHtml::encode(Yii::app()->name);
        $descriptionString = CHtml::encode(Yii::app()->params['description']);
        $siteAddressString = CHtml::encode(Yii::app()->params['siteAddress']);
        $emailString = CHtml::encode(Yii::app()->params['adminEmail']);
        $domain = Yii::app()->request->hostInfo;
        $this->out .= <<<OUT
			<div class='footer' style='margin-top:10px'>
				<p style="text-align:center;height:60px;line-height:60px;margin-bottom: 0px;color:#ecf0f1">
		            &COPY; {$titleString} 2013
		            <span>|</span>
		            <span>
		                <a href="http://weibo.com/pengjava" target="_blank" style="text-decoration:none;">新浪微博</a>
		            </span>
		            <span>|</span>
		            <span>
		                <a href="http://1.t.qq.com/peng896360979" target="_blank" style="text-decoration:none;">腾讯微博</a>
		            </span>
		            <span>|</span>
		            <span>
		                <a target="_blank" href="http://www.gowhich.com/sitemap.xml" style="text-decoration:none;">网站地图</a>
		            </span>
		            <span>|</span>
		            <span>
		                <a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&amp;email=YgYDFAsGGAoDDAVaWyIEDRoPAwsOTAENDw" style="text-decoration:none;">意见反馈</a>
		            </span>
					<span>|</span>
		            <span>
		                <a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=6478598ea632d8cc4800ef0d7e066e0b823c97647f592b3fb72e0009f203b171" title='Gowhich|技术交流群'>QQ群:341268380</a>
		            </span>
		            <span>|</span>
		            <span>
		                <a href="http://feedvalidator.org/check.cgi?url={$domain}/feed"><img src="/images/valid-rss-rogers.png" alt="[Valid RSS]" title="Validate my RSS feed" /></a>
		            </span>
	            </p>
			</div>
OUT;
    }
}


